﻿ using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Office.Interop.Excel;
using System.Drawing;
using System.IO;

public partial class Admin_panel_ThongKe_frmThongKe_PhuLuc_01 : System.Web.UI.Page
{
    public int _nam = 0;
    public BieumauDataContext _db = new BieumauDataContext();
    tblCauHinhThongKe tk = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Request.QueryString["nam"] == null)
                Response.Redirect("Trangchu.aspx");
            lblNam.Text = (Convert.ToInt32(Request.QueryString["nam"]) - 1) + "";
            tk = _db.tblCauHinhThongKes.Single(p => p.ID == "001");
            _nam = Convert.ToInt32(Request.QueryString["nam"]);

          
            lblDonViBaoCao.Text = tk.DonViGui;
            lblDonViNhan.Text = tk.DonViNhan;
            txtGiamDoc.Text = tk.GiamDoc;
            txtNguoiLapBieu.Text = tk.NguoiLapBieu;
            txtDiaDiemKy.Text = tk.NoiGui;
            txtNgayKy.Text = DateTime.Now.Day.ToString();
            txtThangKy.Text = DateTime.Now.Month.ToString();
            txtNamKy.Text = DateTime.Now.Year.ToString();

            txtNgayKy.BackColor = System.Drawing.Color.FromArgb(255, 255, 255);
            txtThangKy.BackColor = System.Drawing.Color.FromArgb(255, 255, 255);
            txtNamKy.BackColor = System.Drawing.Color.FromArgb(255, 255, 255);
           // string path = Server.MapPath("~/userfiles/vanban/ThongKe_PhuLuc_1.xls");
           // Export_To_File(path);
        }
        catch (Exception ex)
        {
            //Response.Redirect("../TimKiem.aspx");
           // throw;
        }

    }

    
    protected void btnIn_Click(object sender, EventArgs e)
    {

        Response.Redirect("../Dulieuthongke.aspx");
        
      


    }
}